<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib  prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <base href="<%=basePath%>">
	<title>阅学网欢迎您！</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta name="Keywords" content="">
	<meta name="description" content="">
	<jsp:include page="/user/common.jsp"></jsp:include>
  </head>
<body>
	<jsp:include page="/user/question/questionLeft.jsp"></jsp:include>
	<div style="float: left;width:980px;margin-top: 8px;margin-left: 30px;">
		 		<form action="user/question/saveQuestion" method="post" id="edit">
			 		<input type="hidden" value="${question.id }" name="id" class="form-control" />
			 		<table>
			 				<tr>
			 						<td>标题:</td>
			 						<td><input type="text" value="${question.questionTitle }" name="questionTitle" class="form-control" /></td>
			 				</tr>	
			 					<tr>
			 							<td>问题类型:</td>
			 							<td>
			 									<select name="questionTypeId" class="form-control">
			 											<c:forEach items="${questionTypes }" var="questionType" >
					 											<option value="${questionType.id }" <c:if test="${questionType.id ==question.questionTypeId }" >selected="selected"</c:if> >${questionType.questionTypeName }</option>
			 											</c:forEach>
			 									</select>
			 							</td>
			 					</tr>	
			 					<tr>
			 							<td>问题等级:</td>
			 							<td>
			 									<select name="questionLevel" class="form-control">
			 											<c:if test="${question.questionLevel ==0}">
				 											<option value="0" selected="selected">普通</option>
				 											<option value="1">急求回答</option>
			 											</c:if>
			 											<c:if test="${question.questionLevel ==1}">
				 											<option value="0">普通</option>
				 											<option value="1"  selected="selected">急求回答</option>
			 											</c:if>
			 									</select>
			 							</td>
			 					</tr>	
			 					<tr>
			 							<td>关键词:</td>
			 							<td><input type="text" name="questionKeyword" value="${question.questionKeyword }" class="form-control"  /></td>
			 					</tr>	
			 					<tr>
			 							<td>悬赏积分:</td>
			 							<td>
			 									<select name="questionIntegral" id=""  class="form-control">
					 									<c:forEach  begin="0" end="10" var="integral">
					 										<option value="${integral }" <c:if test="${question.questionIntegral ==integral  }"> selected="selected"  </c:if>>${integral }</option>
					 									</c:forEach>	
			 									</select>
			 							</td>
			 					</tr>	
			 					<tr>
			 							<td>问题描述:</td>
			 							<td>
			 									<textarea rows="4" name="questionDetail" cols="70" class="form-control">${question.questionDetail }</textarea>
			 							</td>
			 					</tr>	
			 				</table>
					<div  class="upload-closeDiv">
						<button type="submit" class="btn btn-primary btn-sm" onclick="javascript:edit();" style="margin-right: 10px;">确定</button>
					</div>
		 		</form>
				</div>
		</body>
		<script type="text/javascript">
				function edit(){
					document.getElementById("edit").onsubmit();
				}
	</script>
</html>
